﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TrainingsApp.Model;

namespace TrainingsApp.Logic.Import {
    public class ImportManager {

        static readonly Dictionary<ImportType, IDataImport> m_Import_Pool = new Dictionary<ImportType, IDataImport>();

        static ImportManager() {
            m_Import_Pool.Add(ImportType.School, new SchoolTypeImport());
        }

        public static bool Import(int keyId, string location, ImportType type) {
            IDataImport importProvider = null;
            if (m_Import_Pool.TryGetValue(type, out importProvider)) {
                return importProvider.Import(keyId, location, type);
            }
            return false;
        }
    }
}
